<?php 
class DatetimeFormatterHelper extends Helper {
	
	function formatDateWithFormat($format,$datetime){
		list($date,$time) = explode(' ',$datetime);
		list($y, $m, $d ) = explode('-',$date);
		list($h, $i, $s) = explode(':', $time);
		
		$dateObject = mktime($h-1,$i,$s,$m,$d,$y,null);
		return date($format,$dateObject);
	}
	
	function formatDate($datetime){
		return $this->formatDateWithFormat('m/d/Y',$datetime);
	}
	
	function formatTime($datetime) {
		return $this->formatDateWithFormat('h:i:s A',$datetime);
	}
}
?>